const { defineConfig } = require("@vue/cli-service");
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave:false//关闭语法检查
});
const {
  name
} = require('./package');
const isDevelopment = process.env.NODE_ENV === 'development' // 判断是否是生产环境

module.exports = {
  lintOnSave: false, //关闭语法检查
  // publicPath: isDevelopment ? '' : `/qiankun/subPages/${name}/`,
  publicPath: './',
  outputDir: '../dist/subPages/' + name,
  productionSourceMap: isDevelopment,
  devServer: {
      open: false,
      port: 3001,
      headers: {
          'Access-Control-Allow-Origin': '*'
      }
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
      output: {
          library: `${name}-[name]`,
          libraryTarget: 'umd', // 把微应用打包成 umd 库格式
          chunkLoadingGlobal: `webpackJsonp_${name}`
      }
  },
};